package com.feibiao.computer;

import java.util.Scanner;

public class FactoryPatternComputor {
    public static void main(String[] args) {
    	double result = 0;
        ComputeFactory computeFactory = new ComputeFactory();
        Scanner scanner = new Scanner(System.in);
        int flag = 1;
        while(flag == 1) {
        	 System.out.println("请输入运算符+、-、*、/、^、！");
             String operator = scanner.next(); 
             Compute compute = ComputeFactory.getOperator(operator);
             result = compute.compute(); 
             System.out.println("运算结果是：" + result);
             System.out.println("是否继续进行计算，“是”请输入1，“否”请输入非1");
             flag = scanner.nextInt();
        }
        System.out.println("本次计算已结束！！！欢迎下次使用!!!");
       
    }
}
